gsk: Avoid downloading GL textures when possible
authorMatthias Clasen <mclasen@redhat.com>
Sun, 27 Sep 2020 01:55:28 +0000 (21:55 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 27 Sep 2020 01:55:28 +0000 (21:55 -0400)
commit9ca9f42452700b29ccbe40449127018d7077fc7c
tree38f071061dfcfcf5fd5c630beb3ab2455a5fd49f
parent92e551f8958b917885579a6b2cf887aa9546465a
gsk: Avoid downloading GL textures when possible

I found that the gears demo was spending 40% cpu
downloading a GL texture every frame, only to
upload it again to another context.

While the GSK rendering and the GtkGLArea use different
GL contexts, they are (usually) connected by sharing data
with the same global context, so we can just use the
texture without the download/upload dance. This brings
gears down to < 10% cpu.
gsk/gl/gskgldriver.c